#!/usr/bin/env python
import sys, random

def main():
	fileName ="TP3_Random_%s-%s.in" % (sys.argv[1], sys.argv[2]) 
	a = open(fileName, "w+")
	# cantidad de instancias
	for i in range(int(sys.argv[1])):
		# cantidad de nodos por instancias
		a.write(sys.argv[2] + "\n")
		for x in range(1,int(sys.argv[2])):
			used = []
			for j in range(0,random.randrange(1,x+1)):
				value = random.randrange(1,x+1)
				if ( value not in used):
					used.append(value)
					a.write(str(value) + " ")
			a.write("\n")
	a.close()


main()
